package com.bckj.fastboot.core.redisson.configuration;

import com.bckj.fastboot.core.redisson.RLockOps;
import org.redisson.api.RedissonClient;
import org.redisson.spring.starter.RedissonAutoConfigurationV2;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
@AutoConfigureAfter(RedissonAutoConfigurationV2.class)
@ConditionalOnBean(RedissonClient.class)
public class FastRedissonConfiguration {

    @Bean
    @ConditionalOnBean(RedissonClient.class)
    public RLockOps rLockOps(RedissonClient redissonClient) {
        return new RLockOps(redissonClient);
    }
}
